import React, { Component } from 'react'
// 受控组件  (收到state控制的组件)  表单绑定值的时候

export default class Input extends Component {
    state = {
        ipt: "111"
    }
    render() {
        const { ipt } = this.state
        return (
            <div>
                <p>
                    账号：<input onChange={(ev) => {
                        this.setState({
                            ipt: ev.target.value
                        })
                    }} value={ ipt } />
                </p>
                <p>
                    <button>登录</button>
                </p>
                <p>
                    输入的内容为: { ipt }
                </p>
            </div>
        )
    }
}
